package com.decent.core.alarm.entity.bo;

import com.decent.common.enums.alarm.AlarmChannelEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 最终发送报警的业务对象
 *
 * @author menghx
 * @date 2022-03-29
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AlarmBO implements Serializable {
    private static final long serialVersionUID = -6143261335980512188L;
    /**
     * 发送的内容
     */
    @NotBlank(message = "发送的内容不能为空", groups = AfterCheck.class)
    private String content;
    /**
     * 发送的内容前缀
     */
    @NotBlank(message = "发送的内容前缀不能为空", groups = AfterCheck.class)
    private String contentPrefix;
    /**
     * 发送渠道
     */
    @NotNull(message = "发送渠道不能为空", groups = AfterCheck.class)
    private AlarmChannelEnum sendChannel;
    /**
     * 发送地址
     */
    @NotBlank(message = "发送地址不能为空", groups = AfterCheck.class)
    private String url;

    /**
     * 组建参数后的校验
     */
    public interface AfterCheck {
    }

}
